<template>
	<view>
		  <view class="cu-list menu-avatar  card-menu martop" >

		    <view class="cu-item" v-for="(item,index) in lists" :key="index" @tap="toChat(index)">
				<image class="cu-avatar round lg " :src='item.icon'></image>

		      <view class="content">
		        <view class="text-grey">
		          <text class="text-cut">{{item.user_name}}</text>
<!-- 		          <view class="cu-tag round bg-orange sm">战士</view> -->
		        </view>
		        <view class="text-gray text-sm flex">
		          <text class="text-cut">{{item.characters.slice(0,2)+"..."}}</text>
		        </view>
		      </view>
		      <view class="action">
		        <view class="text-grey text-xs focus">
					已关注
				</view>
<!-- 		        <view class="cuIcon-notice_forbid_fill text-gray"></view> -->
		      </view>
		    </view>
		  </view>
		<!-- 聊天消息end -->
	</view>
</template>

<script>
	import store from '../../../globalStore/store.json'
	import data from '../../../datas/data.json'
	export default {
		data() {
			return {
				lists:[]
			}
		},
		onLoad() {
			let user=store.user;
			let focused_users=user.focused_users;
			let all_users=data.users;
			for(let j=0; j<focused_users.length; j++){
				let tmp = focused_users[j];
				for(let i=0; i<all_users.length; i++){
					if(all_users[i].user_id==tmp){
						this.lists.push(all_users[i]);
					}
				}
			}
		},
		methods: {
			toChat:function(index){
				
			}
		}
	}
</script>

<style scoped>
	.icon{
		width: 50px;
		height: 50px;
		border-radius: 50px 50px;
	}
	.focus{
		background: #e12294;
		color: white;
	}
</style>